<?php


namespace Xiaoguai\DesignPattern\DP021\State;


use Xiaoguai\DesignPattern\DP021\Context;
use Xiaoguai\DesignPattern\DP021\StateInterface;

class StateA implements StateInterface
{

    public function handle(Context $context)
    {
        // do something and change state
        echo __CLASS__ . '::' . __METHOD__;

        $context->setState(new StateB());
    }
}